home *** CD-ROM | disk | FTP | other *** search
- From: riley@mipsdal.mips.com (Riley Rainey)
- Newsgroups: comp.sources.x
- Subject: v12i007: acm - X aerial combat simulation, Part02/09
- Message-ID: <8984@exodus.Eng.Sun.COM>
- Date: 2 Mar 91 08:32:13 GMT
- Approved: argv@sun.com
-
- Submitted-by: riley@mipsdal.mips.com (Riley Rainey)
- Posting-number: Volume 12, Issue 7
- Archive-name: acm/part02
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 9)."
- # Contents: acm/V/lib/VClipPoly.c acm/V/lib/VGetEyeSpace.c
- # acm/V/lib/VOpenVp.c acm/V/test/f acm/V/test/f16 acm/V/test/mig23
- # acm/fsim/Imakefile acm/fsim/acm.c acm/fsim/damage.c
- # acm/fsim/eng.xbm acm/fsim/exp.xbm acm/fsim/exp1.xbm acm/fsim/f16
- # acm/fsim/flaps.c acm/fsim/flaps1.xbm acm/fsim/init.c
- # acm/fsim/mig23 acm/fsim/missileCalc.c acm/fsim/panel.c
- # Wrapped by riley@mipsdal on Thu Feb 14 10:09:17 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'acm/V/lib/VClipPoly.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/V/lib/VClipPoly.c'\"
- else
- echo shar: Extracting \"'acm/V/lib/VClipPoly.c'\" \(2128 characters\)
- sed "s/^X//" >'acm/V/lib/VClipPoly.c' <<'END_OF_FILE'
- X#include "Vlib.h"
- X
- XVPolygon * _VClipPolygon (poly, clipPlane)
- XVPolygon *poly;
- XVPoint *clipPlane; {
- X
- X register int j, lastj, numPts = 0, clipped = 0;
- X double d1, d2, a;
- X VPoint tmpPoint[64];
- X VPolygon *p;
- X
- X if (poly->numVtces > 0) {
- X
- X lastj = poly->numVtces-1;
- X d1 = VDotProd(&(poly->vertex[poly->numVtces-1]), clipPlane);
- X numPts = 0;
- X
- X/*
- X * Examine each vertex and determine if it is inside or outside of the
- X * specified clipping plane.
- X */
- X
- X for (j=0; j<poly->numVtces; ++j) {
- X
- X/* Leading vertex inside? */
- X
- X if (d1 > 0.0)
- X tmpPoint[numPts++] = poly->vertex[lastj];
- X
- X d2 = VDotProd(&(poly->vertex[j]), clipPlane);
- X
- X/* Does the edge straddle the window? If so, add a vertex on the window */
- X
- X if (d1 * d2 < 0.0) {
- X clipped = 1;
- X a = d1 / (d1 - d2);
- X tmpPoint[numPts].x = a * poly->vertex[j].x +
- X (1.0 - a) * poly->vertex[lastj].x;
- X tmpPoint[numPts].y = a * poly->vertex[j].y +
- X (1.0 - a) * poly->vertex[lastj].y;
- X tmpPoint[numPts++].z = a * poly->vertex[j].z +
- X (1.0 - a) * poly->vertex[lastj].z;
- X }
- X
- X lastj = j;
- X d1 = d2;
- X }
- X }
- X
- X/*
- X * If the polygon was completely out of bounds, delete this polygon.
- X */
- X
- X if (numPts == 0) {
- X p = (VPolygon *) NULL;
- X VDestroyPolygon (poly);
- X#ifdef DEBUG
- X fprintf (stderr, "VClipPolygon: polygon outside area of interest\n");
- X#endif
- X }
- X
- X/*
- X * If we did any clipping, return the clipped polygon.
- X */
- X
- X else if (clipped != 0) {
- X p = VCreatePolygon(numPts, &tmpPoint[0], poly->color);
- X#ifdef DEBUG
- X fprintf (stderr, "VClipPolygon: Polygon has been clipped:\n");
- X fprintf (stderr, "Before Clipping:\n");
- X VPrintPolygon (stderr, poly);
- X fprintf (stderr, "\nAfter Clipping:\n\n");
- X VPrintPolygon (stderr, p);
- X#endif
- X VDestroyPolygon (poly);
- X }
- X else
- X p = poly;
- X
- X return p;
- X}
- X
- XVPolygon * VClipPolygon (poly, clipPoly)
- XVPolygon *poly, *clipPoly; {
- X
- X int i;
- X VPolygon *p = poly;
- X
- X/*
- X * Clip against each clipping plane supplied, one at a time.
- X */
- X
- X for (i=0; i<clipPoly->numVtces; ++i) {
- X
- X if (p == (VPolygon *) NULL)
- X break;
- X
- X p = _VClipPolygon (p, &(clipPoly->vertex[i]));
- X
- X }
- X
- X return p;
- X}
- END_OF_FILE
- if test 2128 -ne `wc -c <'acm/V/lib/VClipPoly.c'`; then
- echo shar: \"'acm/V/lib/VClipPoly.c'\" unpacked with wrong size!
- fi
- # end of 'acm/V/lib/VClipPoly.c'
- fi
- if test -f 'acm/V/lib/VGetEyeSpace.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/V/lib/VGetEyeSpace.c'\"
- else
- echo shar: Extracting \"'acm/V/lib/VGetEyeSpace.c'\" \(1794 characters\)
- sed "s/^X//" >'acm/V/lib/VGetEyeSpace.c' <<'END_OF_FILE'
- X#include "Vlib.h"
- X#include <math.h>
- X
- Xvoid VGetEyeSpace (v, EyePt, CntrInt, up)
- XViewport *v;
- XVPoint EyePt, CntrInt, up; {
- X
- X VMatrix Mtx, es;
- X VPoint C1, C2;
- X double Hypotenuse, h1, CosA, SinA;
- X
- X/*
- X * Calculate the eye space transformation matrix
- X *
- X * First, orient the Z axis towards the center of interest.
- X */
- X
- X VIdentMatrix (&(v->eyeSpace));
- X v->eyeSpace.m[0][3] = -EyePt.x;
- X v->eyeSpace.m[1][3] = -EyePt.y;
- X v->eyeSpace.m[2][3] = -EyePt.z;
- X VTransform(&CntrInt, &(v->eyeSpace), &C1);
- X
- X VIdentMatrix (&Mtx);
- X Hypotenuse = sqrt(C1.x * C1.x + C1.y * C1.y);
- X if (Hypotenuse > 0.0) {
- X CosA = C1.y / Hypotenuse;
- X SinA = C1.x / Hypotenuse;
- X Mtx.m[0][0] = CosA;
- X Mtx.m[1][0] = SinA;
- X Mtx.m[0][1] = -SinA;
- X Mtx.m[1][1] = CosA;
- X es = v->eyeSpace;
- X VMatrixMult(&es, &Mtx, &(v->eyeSpace));
- X }
- X
- X VTransform(&CntrInt, &(v->eyeSpace), &C2);
- X VIdentMatrix (&Mtx);
- X Hypotenuse = sqrt(C2.y * C2.y + C2.z * C2.z);
- X if (Hypotenuse > 0.0) {
- X CosA = C2.y / Hypotenuse;
- X SinA = -C2.z / Hypotenuse;
- X Mtx.m[1][1] = CosA;
- X Mtx.m[2][1] = SinA;
- X Mtx.m[1][2] = -SinA;
- X Mtx.m[2][2] = CosA;
- X es = v->eyeSpace;
- X VMatrixMult(&es, &Mtx, &(v->eyeSpace));
- X }
- X
- X/*
- X * Orient the y axis towards "up". Swap y and z axes.
- X */
- X
- X VTransform (&up, &(v->eyeSpace), &C2);
- X VIdentMatrix (&Mtx);
- X h1 = sqrt (C2.y * C2.y + C2.z * C2.z);
- X Hypotenuse = sqrt(C2.x * C2.x + h1 * h1);
- X if (Hypotenuse > 0.0) {
- X CosA = h1 / Hypotenuse;
- X SinA = C2.x / Hypotenuse;
- X if (C2.z < 0.0) {
- X CosA = -CosA;
- X }
- X Mtx.m[0][0] = CosA;
- X Mtx.m[2][0] = SinA;
- X Mtx.m[0][2] = -SinA;
- X Mtx.m[2][2] = CosA;
- X es = v->eyeSpace;
- X VMatrixMult(&es, &Mtx, &(v->eyeSpace));
- X }
- X
- X VIdentMatrix (&Mtx);
- X Mtx.m[1][1] = 0.0;
- X Mtx.m[2][1] = 1.0;
- X Mtx.m[1][2] = 1.0;
- X Mtx.m[2][2] = 0.0;
- X es = v->eyeSpace;
- X VMatrixMult(&es, &Mtx, &(v->eyeSpace));
- X
- X}
- END_OF_FILE
- if test 1794 -ne `wc -c <'acm/V/lib/VGetEyeSpace.c'`; then
- echo shar: \"'acm/V/lib/VGetEyeSpace.c'\" unpacked with wrong size!
- fi
- # end of 'acm/V/lib/VGetEyeSpace.c'
- fi
- if test -f 'acm/V/lib/VOpenVp.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/V/lib/VOpenVp.c'\"
- else
- echo shar: Extracting \"'acm/V/lib/VOpenVp.c'\" \(2391 characters\)
- sed "s/^X//" >'acm/V/lib/VOpenVp.c' <<'END_OF_FILE'
- X#include "Vlib.h"
- X
- XViewport *VOpenViewport (dpy, screen, win, unit, dist, scale, width, height)
- XDisplay *dpy;
- Xint screen;
- XWindow win;
- Xdouble unit;
- Xdouble dist;
- Xdouble scale;
- Xint width;
- Xint height; {
- X
- X Viewport *v;
- X VPoint clip[4];
- X int planes;
- X
- X/*
- X * Allocate space for the Viewport structure
- X */
- X
- X v = (Viewport *) Vmalloc (sizeof(Viewport));
- X
- X/*
- X * Calculate screen resolution in pixels per unit.
- X */
- X
- X v->dist = dist;
- X v->units = unit;
- X
- X v->xres = ((((double) DisplayWidth(dpy,screen)) * unit * 1000.0) /
- X ((double) DisplayWidthMM(dpy,screen)));
- X v->yres = ((((double) DisplayHeight(dpy,screen)) * unit * 1000.0) /
- X ((double) DisplayHeightMM(dpy,screen)));
- X/*
- X * Use that info to set scaling factors.
- X */
- X
- X v->Scale.x = v->xres * dist * scale;
- X v->Scale.y = v->yres * dist * scale;
- X v->Scale.z = 1.0;
- X
- X v->Middl.x = (double) width / 2.0;
- X v->Middl.y = (double) height / 2.0;
- X v->Middl.z = 0.0;
- X
- X/*
- X * Build the clipping planes for our view into the eye space.
- X */
- X
- X clip[0].x = - width / v->xres / 2.0 / scale;
- X clip[0].y = - height / v->yres / 2.0 / scale;
- X clip[0].z = dist;
- X clip[1].x = - width / v->xres / 2.0 / scale;
- X clip[1].y = height / v->yres / 2.0 / scale;
- X clip[1].z = dist;
- X clip[2].x = width / v->xres / 2.0 / scale;
- X clip[2].y = height / v->yres / 2.0 / scale;
- X clip[2].z = dist;
- X clip[3].x = width / v->xres / 2.0 / scale;
- X clip[3].y = - height / v->yres / 2.0 / scale;
- X clip[3].z = dist;
- X
- X v->clipPoly = VCreatePolygon (4, clip);
- X VGetPlanes (v->clipPoly);
- X
- X/*
- X * Fill out the rest of the structure.
- X */
- X
- X v->flags = VPPerspective | VPClip;
- X v->dpy = dpy;
- X v->screen = screen;
- X v->win = win;
- X VIdentMatrix (&v->eyeSpace);
- X v->set = 0;
- X v->width = width;
- X v->height = height;
- X
- X/*
- X * Is this a monochrome situation? We also resort to monochrome on
- X * color systems that probably won't have enough color cell space
- X * to support double buffering. We'll also use pixmaps if the
- X * global variable "usePixmaps" is non-zero.
- X */
- X
- X planes = DisplayPlanes (dpy, screen);
- X if (planes < PLANES*2+2 || usePixmaps != 0) {
- X v->monoPixmap = XCreatePixmap (dpy, RootWindow(dpy, screen), width, height, planes);
- X v->flags |= VPPixmap;
- X if (planes == 1)
- X v->flags |= VPMono;
- X }
- X
- X return v;
- X}
- END_OF_FILE
- if test 2391 -ne `wc -c <'acm/V/lib/VOpenVp.c'`; then
- echo shar: \"'acm/V/lib/VOpenVp.c'\" unpacked with wrong size!
- fi
- # end of 'acm/V/lib/VOpenVp.c'
- fi
- if test -f 'acm/V/test/f' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/V/test/f'\"
- else
- echo shar: Extracting \"'acm/V/test/f'\" \(2026 characters\)
- sed "s/^X//" >'acm/V/test/f' <<'END_OF_FILE'
- XF-16-fighter
- X90 9
- X1 -18.165 0 0
- X2 -18.165 -1.191 0
- X3 -15.187 -2.085 0
- X4 -13.698 -2.382 0
- X5 -17.272 -2.382 0
- X6 -17.272 -3.573 0
- X7 -10.923 -3.573 0
- X8 -4.169 -3.573 0
- X9 -4.169 -4.765 0
- X10 5.598 -4.765 0
- X11 18.463 -2.144 0
- X12 18.939 -1.787 0
- X13 22.274 -1.489 0
- X14 24.895 -1.191 0
- X15 27.992 0 0
- X16 -6.551 -3.573 0
- X17 -6.551 -15.485 0
- X18 0.357 -15.485 0
- X19 0.357 -15.187 0
- X20 -2.978 -15.008 0
- X21 5.598 -4.765 0
- X22 -4.169 -4.765 0
- X23 -4.169 -3.573 0
- X24 -17.272 -3.573 0
- X25 -17.272 -8.934 0.893
- X26 -15.187 -8.934 0.893
- X27 -10.923 -3.573 0
- X28 27.992 0 0
- X29 24.895 1.191 0
- X30 22.274 1.489 0
- X31 18.939 1.787 0
- X32 18.463 2.144 0
- X33 5.598 4.765 0
- X34 -4.169 4.765 0
- X35 -4.169 3.573 0
- X36 -10.923 3.573 0
- X37 -17.272 3.573 0
- X38 -17.272 2.382 0
- X39 -13.698 2.382 0
- X40 -15.187 2.085 0
- X41 -18.165 1.191 0
- X42 -18.165 0 0
- X43 5.598 4.765 0
- X44 -2.978 15.008 0
- X45 0.357 15.187 0
- X46 0.357 15.485 0
- X47 -6.551 15.485 0
- X48 -6.551 3.573 0
- X49 -4.169 3.573 0
- X50 -4.169 4.765 0
- X51 -10.923 3.573 0
- X52 -15.187 8.934 0.893
- X53 -17.272 8.934 0.893
- X54 -17.272 3.573 0
- X55 27.992 0 0
- X56 23.525 0 -1.191
- X57 17.272 0 -2.382
- X58 15.783 0 -3.812
- X59 13.996 0 -4.169
- X60 11.316 0 -4.05
- X61 8.338 0 -3.335
- X62 1.787 0 -2.382
- X63 -4.169 0 -2.382
- X64 -13.936 0 -1.906
- X65 -15.128 0 -1.906
- X66 -15.187 0 -1.787
- X67 -18.165 0 -1.191
- X68 -18.165 0 0
- X69 -4.169 0 -2.382
- X70 -10.125 0 -4.05
- X71 -15.783 0 -10.482
- X72 -19.654 0 -10.482
- X73 -19.654 0 -9.529
- X74 -19.654 0 -9.529
- X75 -16.378 0 -3.573
- X76 -16.378 0 -2.144
- X77 -14.889 0 -2.382
- X78 -13.936 0 -2.382
- X79 -13.936 0 -1.906
- X80 -18.165 0 0
- X81 -18.165 0 1.191
- X82 -15.187 0 2.085
- X83 -13.698 0 2.263
- X84 -2.68 0 2.382
- X85 8.04 0 2.382
- X86 12.507 0 2.263
- X87 12.507 0 0.596
- X88 19.952 0 0.596
- X89 23.525 0 0.476
- X90 27.992 0 0
- Xgray 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Xgray 8 16 17 18 19 20 21 22 23
- Xgray 4 24 25 26 27
- Xgray 15 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
- Xgray 8 43 44 45 46 47 48 49 50
- Xgray 4 51 52 53 54
- Xgray 14 55 56 57 58 59 60 61 62 63 64 65 66 67 68
- Xgray 11 69 70 71 72 73 74 75 76 77 78 79
- Xgray 11 80 81 82 83 84 85 86 87 88 89 90
- END_OF_FILE
- if test 2026 -ne `wc -c <'acm/V/test/f'`; then
- echo shar: \"'acm/V/test/f'\" unpacked with wrong size!
- fi
- # end of 'acm/V/test/f'
- fi
- if test -f 'acm/V/test/f16' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/V/test/f16'\"
- else
- echo shar: Extracting \"'acm/V/test/f16'\" \(3135 characters\)
- sed "s/^X//" >'acm/V/test/f16' <<'END_OF_FILE'
- XF-16-fighter
- X130 12
- X1 -18.165 0 0
- X2 -18.165 -1.191 0
- X3 -15.187 -2.085 0
- X4 -13.698 -2.382 0
- X5 -17.272 -2.382 0
- X6 -17.272 -3.573 0
- X7 -10.923 -3.573 0
- X8 -4.169 -3.573 0
- X9 -4.169 -4.765 0
- X10 5.598 -4.765 0
- X11 18.463 -2.144 0
- X12 18.939 -1.787 0
- X13 22.274 -1.489 0
- X14 24.895 -1.191 0
- X15 27.992 0 0
- X16 -6.551 -3.573 0
- X17 -6.551 -15.485 0
- X18 0.357 -15.485 0
- X19 0.357 -15.187 0
- X20 -2.978 -15.008 0
- X21 5.598 -4.765 0
- X22 -4.169 -4.765 0
- X23 -4.169 -3.573 0
- X24 -17.272 -3.573 0
- X25 -17.272 -8.934 0.893
- X26 -15.187 -8.934 0.893
- X27 -10.923 -3.573 0
- X28 27.992 0 0
- X29 24.895 1.191 0
- X30 22.274 1.489 0
- X31 18.939 1.787 0
- X32 18.463 2.144 0
- X33 5.598 4.765 0
- X34 -4.169 4.765 0
- X35 -4.169 3.573 0
- X36 -10.923 3.573 0
- X37 -17.272 3.573 0
- X38 -17.272 2.382 0
- X39 -13.698 2.382 0
- X40 -15.187 2.085 0
- X41 -18.165 1.191 0
- X42 -18.165 0 0
- X43 5.598 4.765 0
- X44 -2.978 15.008 0
- X45 0.357 15.187 0
- X46 0.357 15.485 0
- X47 -6.551 15.485 0
- X48 -6.551 3.573 0
- X49 -4.169 3.573 0
- X50 -4.169 4.765 0
- X51 -10.923 3.573 0
- X52 -15.187 8.934 0.893
- X53 -17.272 8.934 0.893
- X54 -17.272 3.573 0
- X55 27.992 0 0
- X56 23.525 0 -1.191
- X57 17.272 0 -2.382
- X58 15.783 0 -3.812
- X59 13.996 0 -4.169
- X60 11.316 0 -4.05
- X61 8.338 0 -3.335
- X62 1.787 0 -2.382
- X63 -4.169 0 -2.382
- X64 -13.936 0 -1.906
- X65 -15.128 0 -1.906
- X66 -15.187 0 -1.787
- X67 -18.165 0 -1.191
- X68 -18.165 0 0
- X69 -4.169 0 -2.382
- X70 -10.125 0 -4.05
- X71 -15.783 0 -10.482
- X72 -19.654 0 -10.482
- X73 -19.654 0 -9.529
- X74 -19.654 0 -9.529
- X75 -16.378 0 -3.573
- X76 -16.378 0 -2.144
- X77 -14.889 0 -2.382
- X78 -13.936 0 -2.382
- X79 -13.936 0 -1.906
- X80 -18.165 0 0
- X81 -18.165 0 1.191
- X82 -15.187 0 2.085
- X83 -13.698 0 2.263
- X84 -2.68 0 2.382
- X85 8.04 0 2.382
- X86 12.507 0 2.263
- X87 12.507 0 0.596
- X88 19.952 0 0.596
- X89 23.525 0 0.476
- X90 27.992 0 0
- X91 -3.551 0 -2.382
- X92 -3.551 -3.871 -0.10
- X93 -3.551 -15.485 0
- X94 -3.551 -15.485 0.1065
- X95 -3.551 -3.871 0.142
- X96 -3.551 -2.58 0.2556
- X97 -3.551 -2.387 1.818
- X98 -3.551 -2.102 2.015
- X99 -3.551 -1.03 2.251
- X100 -3.551 0 2.282
- X101 -3.551 1.03 2.251
- X102 -3.551 2.102 2.015
- X103 -3.551 2.387 1.818
- X104 -3.551 2.58 0.2556
- X105 -3.551 3.871 0.142
- X106 -3.551 15.485 0.1065
- X107 -3.551 15.485 0
- X108 -3.551 3.871 -0.10
- X109 13.996 0 -4.169
- X110 13.996 -0.8932 -3.692
- X111 13.996 -1.191 -2.978
- X112 13.996 -1.251 -2.502
- X113 13.996 -1.787 -1.311
- X114 13.996 -3.054 0
- X115 13.996 -1.583 0.3568
- X116 13.996 0 0.596
- X117 13.996 1.583 0.3568
- X118 13.996 3.054 0
- X119 13.996 1.787 -1.311
- X120 13.996 1.251 -2.502
- X121 13.996 1.191 -2.978
- X122 13.996 0.8932 -3.692
- X123 -18.165 1.191 0
- X124 -18.165 0.842 0.842
- X125 -18.165 0 1.191
- X126 -18.165 -0.842 0.842
- X127 -18.165 -1.191 0
- X128 -18.165 -0.842 -0.842
- X129 -18.165 0 -1.191
- X130 -18.165 0.842 -0.842
- Xgray33 14 109 110 111 112 113 114 115 116 117 118 119 120 121 122
- Xgray33 18 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
- Xgray33 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Xgray33 8 16 17 18 19 20 21 22 23
- Xgray33 4 24 25 26 27
- Xgray33 15 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
- Xgray33 8 43 44 45 46 47 48 49 50
- Xgray33 4 51 52 53 54
- Xgray33 14 55 56 57 58 59 60 61 62 63 64 65 66 67 68
- Xgray33 11 69 70 71 72 73 74 75 76 77 78 79
- Xgray33 11 80 81 82 83 84 85 86 87 88 89 90
- Xgray33 8 123 124 125 126 127 128 129 130
- END_OF_FILE
- if test 3135 -ne `wc -c <'acm/V/test/f16'`; then
- echo shar: \"'acm/V/test/f16'\" unpacked with wrong size!
- fi
- # end of 'acm/V/test/f16'
- fi
- if test -f 'acm/V/test/mig23' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/V/test/mig23'\"
- else
- echo shar: Extracting \"'acm/V/test/mig23'\" \(2494 characters\)
- sed "s/^X//" >'acm/V/test/mig23' <<'END_OF_FILE'
- Xmig-23-wings-swept
- X88 10
- X1 36.5891 0 0
- X2 34.4368 0.86092 0
- X3 30.9931 1.29138 0
- X4 27.119 1.72184 0
- X5 20.6621 1.72184 0
- X6 18.9402 2.1523 0
- X7 14.2052 3.01322 0
- X8 -3.44368 2.58276 0
- X9 -9.03966 2.1523 0
- X10 -16.7879 0.86092 0
- X11 -18.0793 0.43046 0
- X12 -18.0793 0 0
- X13 36.5891 0 0
- X14 34.4368 -0.86092 0
- X15 30.9931 -1.29138 0
- X16 27.119 -1.72184 0
- X17 20.6621 -1.72184 0
- X18 18.9402 -2.1523 0
- X19 14.2052 -3.01322 0
- X20 -3.44368 -2.58276 0
- X21 -9.03966 -2.1523 0
- X22 -16.7879 -0.86092 0
- X23 -18.0793 -0.43046 0
- X24 -18.0793 0 0
- X25 14.2052 3.01322 -3.01322
- X26 4.73506 7.31782 -3.01322
- X27 6.02644 8.6092 -3.01322
- X28 -11.192 13.7747 -3.01322
- X29 -12.0529 13.7747 -3.01322
- X30 -14.2052 11.192 -3.01322
- X31 -14.2052 10.7615 -3.01322
- X32 -3.44368 2.58276 -3.01322
- X33 14.2052 -3.01322 -3.01322
- X34 4.73506 -7.31782 -3.01322
- X35 6.02644 -8.6092 -3.01322
- X36 -11.192 -13.7747 -3.01322
- X37 -12.0529 -13.7747 -3.01322
- X38 -14.2052 -11.192 -3.01322
- X39 -14.2052 -10.7615 -3.01322
- X40 -3.44368 -2.58276 -3.01322
- X41 -18.9402 3.01322 -1.72184
- X42 -20.2316 7.31782 -1.72184
- X43 -18.5098 8.6092 -1.72184
- X44 -9.03966 2.1523 -1.72184
- X45 -16.7879 0.86092 -1.72184
- X46 -18.9402 -3.01322 -1.72184
- X47 -20.2316 -7.31782 -1.72184
- X48 -18.5098 -8.6092 -1.72184
- X49 -9.03966 -2.1523 -1.72184
- X50 -16.7879 -0.86092 -1.72184
- X51 36.5891 0 0
- X52 33.1454 0 -1.29138
- X53 30.1322 0 -2.1523
- X54 25.8276 0 -2.58276
- X55 22.3839 0 -3.87414
- X56 18.0793 0 -4.3046
- X57 9.47012 0 -3.87414
- X58 -0.860918 0 -3.44368
- X59 -8.6092 0 -6.02644
- X60 -16.3575 0 -10.331
- X61 -18.9402 0 -9.03966
- X62 -18.0793 0 -3.87414
- X63 -19.8012 0 -3.44368
- X64 -17.2184 0 -1.72184
- X65 -18.0793 0 -1.72184
- X66 -18.0793 0 1.29138
- X67 -15.4966 0 1.72184
- X68 -6.4569 0 2.1523
- X69 10.331 0 2.1523
- X70 20.2316 0 1.72184
- X71 28.8408 0 1.29138
- X72 33.1454 0 0.86092
- X73 -15.4966 0 1.72184
- X74 -15.4966 0 4.3046
- X75 -13.3443 0 5.16552
- X76 -6.4569 0 2.1523
- X77 20.6621 1.72184 -3.01322
- X78 18.9402 2.1523 -3.01322
- X79 14.2052 3.01322 -3.01322
- X80 -3.44368 2.58276 -3.01322
- X81 -3.44368 -2.58276 -3.01322
- X82 14.2052 -3.01322 -3.01322
- X83 18.9402 -2.1523 -3.01322
- X84 20.6621 -1.72184 -3.01322
- X85 -3.44368 2.58276 -3.01322
- X86 -16.7879 0.86092 -1.72184
- X87 -16.7879 -0.86092 -1.72184
- X88 -3.44368 -2.58276 -3.01322
- Xgray 12 1 2 3 4 5 6 7 8 9 10 11 12
- Xgray 12 13 14 15 16 17 18 19 20 21 22 23 24
- Xgray 8 25 26 27 28 29 30 31 32
- Xgray 8 33 34 35 36 37 38 39 40
- Xgray 5 41 42 43 44 45
- Xgray 5 46 47 48 49 50
- Xgray 22 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
- Xgray 4 73 74 75 76
- Xgray 8 77 78 79 80 81 82 83 84
- Xgray 4 85 86 87 88
- END_OF_FILE
- if test 2494 -ne `wc -c <'acm/V/test/mig23'`; then
- echo shar: \"'acm/V/test/mig23'\" unpacked with wrong size!
- fi
- # end of 'acm/V/test/mig23'
- fi
- if test -f 'acm/fsim/Imakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/Imakefile'\"
- else
- echo shar: Extracting \"'acm/fsim/Imakefile'\" \(2147 characters\)
- sed "s/^X//" >'acm/fsim/Imakefile' <<'END_OF_FILE'
- X/*
- X * mips RISC/os should add "-systype bsd43" to CDEBUGFLAGS.
- X *
- X * dec 5000 series systems should add -Ddec to CDEBUGFLAGS. Once
- X * again, I don't know the symbol, so I can't do it right here.
- X *
- X * System V systems needs -DSYSV, but I think that's done
- X * automatically by the Imake configuration files for System V-like
- X * systems, so you probably shouldn't have to worry about it.
- X */
- X
- X#include "../acm.def"
- X
- X/*
- X * For Mips RISC/OS:
- X * My IMAKEINCLUDE environment variable is set to "-I. -Dmips -SYSTYPE_BSD"
- X */
- X#ifdef MipsArchitecture
- XCDEBUGFLAGS = -systype bsd43 $(STD_INCLUDES) -O
- XXLIB = -lX11
- X#endif
- X
- X#if HasVoidSignalReturn == YES
- XDEFINES= -DSIGVOID
- X#endif
- X
- XSRCS1= server.c pm.c flaps.c droneCalc.c init.c aim9m.c\
- X m61a1.c weapon.c newPlayer.c newPlane.c missile.c\
- X missileCalc.c update.c doEvents.c getStick.c\
- X damage.c panel.c doViews.c\
- X doRadar.c placeCraft.c transpose.c doScale.c
- XOBJS1= server.o pm.o flaps.o droneCalc.o init.o aim9m.o\
- X m61a1.o weapon.o newPlayer.o newPlane.o missile.o\
- X missileCalc.o update.o doEvents.o getStick.o\
- X damage.o panel.o doViews.o\
- X doRadar.o placeCraft.o transpose.o doScale.o
- XDEPLIBS1= ../V/lib/libV.a
- X
- XSRCS2= acm.c
- XOBJS2= acm.o
- XDEPLIBS2=
- X
- XSRCS3= V2tgif.c
- XOBJS3= V2tgif.o
- XDEPLIBS3= ../V/lib/libV.a
- X
- XPROGRAMS= acm acms v2tgif
- XSTD_INCLUDES= -I../V/lib
- X#ifdef notdef
- XLOCAL_LIBRARIES= -L../V/lib -lV -lm $(XLIB)
- X#endif
- XLOCAL_LIBRARIES= ../V/lib/libV.a
- XSYS_LIBRARIES= -lm $(XLIB)
- X
- XOBJS= $(OBJS1) $(OBJS2) $(OBJS3)
- XSRCS= $(SRCS1) $(SRCS2) $(SRCS3)
- X
- XAllTarget($(PROGRAMS))
- X
- XNormalProgramTarget(acms,$(OBJS1),$(DEPLIBS1),$(LOCAL_LIBRARIES),)
- XSaberProgramTarget(acms,$(SRCS1),$(OBJS1),$(LOCAL_LIBRARIES),)
- X
- XInstallProgram(acms,$(BINDIR))
- X
- XNormalProgramTarget(acm,$(OBJS2),$(DEPLIBS2),$(LOCAL_LIBRARIES),)
- XSaberProgramTarget(acm,$(SRCS2),$(OBJS2),$(LOCAL_LIBRARIES),)
- X
- XInstallProgram(acm,$(BINDIR))
- XInstallManPage(acm,$(MANDIR))
- X
- XNormalProgramTarget(v2tgif,$(OBJS3),$(DEPLIBS3),$(LOCAL_LIBRARIES),)
- XSaberProgramTarget(v2tgif,$(SRCS3),$(OBJS3),$(LOCAL_LIBRARIES),)
- X
- XDependTarget()
- XLintTarget()
- X
- Xinstall:: install.man
- X
- Xtar:
- X tar cv acm acms f16 mig23 aim-9 rwy rwy2 tower mtn bullet
- END_OF_FILE
- if test 2147 -ne `wc -c <'acm/fsim/Imakefile'`; then
- echo shar: \"'acm/fsim/Imakefile'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/Imakefile'
- fi
- if test -f 'acm/fsim/acm.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/acm.c'\"
- else
- echo shar: Extracting \"'acm/fsim/acm.c'\" \(2789 characters\)
- sed "s/^X//" >'acm/fsim/acm.c' <<'END_OF_FILE'
- X/*
- X * xflight : an aerial combat simulator for X
- X *
- X * Written by Riley Rainey, riley@mips.com
- X *
- X * Permission to use, copy, modify and distribute (without charge) this
- X * software, documentation, images, etc. is granted, provided that this
- X * comment and the author's name is retained.
- X *
- X */
- X
- X#include "manifest.h"
- X#include <sys/types.h>
- X#include <stdio.h>
- X#include <pwd.h>
- X#include <signal.h>
- X#include <sys/socket.h>
- X#include <netinet/in.h>
- X#include <netdb.h>
- X#include <setjmp.h>
- X
- Xextern char *getenv ();
- Xextern struct servent *getservent();
- X
- Xjmp_buf dead;
- X
- Xdone () {
- X longjmp (dead);
- X}
- X
- Xmain (argc, argv)
- Xint argc;
- Xchar *argv[]; {
- X
- X char *display;
- X char *host;
- X char myhost[64];
- X char args[128];
- X int s, n = 1;
- X struct passwd *pwent, *getpwuid();
- X struct sockaddr_in sin;
- X struct hostent *h = (struct hostent *) NULL;
- X
- X if ((host = getenv("ACMSERVER")) == NULL)
- X if (argc >= 2) {
- X host = argv[1];
- X n = 2;
- X }
- X else {
- X fprintf (stderr, "usage: %s server-hostname\n", argv[0]);
- X exit (1);
- X }
- X
- X if ((pwent = getpwuid(getuid())) == NULL) {
- X fprintf (stderr, "Yow!\n");
- X exit (1);
- X }
- X
- X if ((display = getenv("DISPLAY")) == NULL) {
- X fprintf (stderr, "Excuse me, but you have no DISPLAY.\n\
- XHow do you use X, anyway?\n");
- X exit (1);
- X }
- X
- X/*
- X * Sometimes we end up with a DISPLAY value that won't jive on the
- X * network (e.g. ":0.0") -- fix these cases.
- X */
- X
- X if (*display == ':') {
- X gethostname (myhost, sizeof(myhost));
- X strcat (myhost, display);
- X display = myhost;
- X }
- X else if (strcmp (display, "unix:0.0") == 0 ||
- X strcmp (display, "unix:0") == 0) {
- X gethostname (myhost, sizeof(myhost));
- X strcat (myhost, ":0.0");
- X display = myhost;
- X }
- X
- X if ((sin.sin_addr.s_addr = inet_addr (host)) != -1) {
- X sin.sin_family = AF_INET;
- X }
- X else if ((h = gethostbyname (host)) != 0) {
- X sin.sin_family = h->h_addrtype;
- X bcopy (h->h_addr, &sin.sin_addr, h->h_length);
- X }
- X else {
- X fprintf (stderr, "Unknown host \"%s\"\n", host);
- X exit (1);
- X }
- X
- X sin.sin_port = htons(ACM_PORT);
- X
- X signal (SIGPIPE, done);
- X
- X if ((s = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
- X perror ("can't get a socket");
- X exit (1);
- X }
- X
- X if (connect (s, (struct sockaddr *) &sin, sizeof (sin)) < 0) {
- X perror ("can't connect to server");
- X close (s);
- X exit (1);
- X }
- X
- X if (argv[n] != (char *) NULL)
- X strcpy (args, argv[n++]);
- X else
- X strcpy (args, "");
- X
- X for (; argv[n] != (char *) NULL; ++n) {
- X strcat (args, "|");
- X strcat (args, argv[n]);
- X }
- X
- X if (setjmp (dead) == 0)
- X handshake (s, display, pwent->pw_name, args);
- X
- X exit (0);
- X}
- X
- Xhandshake (s, dpy, name, args)
- Xint s;
- Xchar *dpy, *name, *args; {
- X
- X char info[128];
- X int n;
- X
- X sprintf (info, "%s %s %s\n", dpy, name, args);
- X write (s, info, strlen (info));
- X while ((n = read (s, info, sizeof (info))) > 0)
- X write (fileno (stdout), info, n);
- X
- X return 0;
- X}
- END_OF_FILE
- if test 2789 -ne `wc -c <'acm/fsim/acm.c'`; then
- echo shar: \"'acm/fsim/acm.c'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/acm.c'
- fi
- if test -f 'acm/fsim/damage.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/damage.c'\"
- else
- echo shar: Extracting \"'acm/fsim/damage.c'\" \(2826 characters\)
- sed "s/^X//" >'acm/fsim/damage.c' <<'END_OF_FILE'
- X/*
- X * xflight : an aerial combat simulator for X
- X *
- X * Written by Riley Rainey, riley@mips.com
- X *
- X * Permission to use, copy, modify and distribute (without charge) this
- X * software, documentation, images, etc. is granted, provided that this
- X * comment and the author's name is retained.
- X *
- X */
- X
- X#include "pm.h"
- X#include "damage.h"
- X
- Xextern long random();
- X
- Xdouble frandom () {
- X
- X return (double) (random() & 0xffff) / 65536.0;
- X}
- X
- X/*
- X * Select a subsystem to receive damage.
- X */
- X
- Xlong selectSystem () {
- X
- X double r;
- X long i;
- X
- X if ((r = frandom()) < 0.25)
- X i = SYS_ENGINE1;
- X else if (r < 0.35)
- X i = SYS_RADAR;
- X else if (r < 0.40)
- X i = SYS_TEWS;
- X else if (r < 0.45)
- X i = SYS_HYD1;
- X else if (r < 0.50)
- X i = SYS_HYD2;
- X else if (r < 0.55)
- X i = SYS_GEN1;
- X else if (r < 0.60)
- X i = SYS_GEN2;
- X else if (r < 0.65)
- X i = SYS_FLAPS;
- X else if (r < 0.70)
- X i = SYS_SPEEDBRAKE;
- X else if (r < 0.80)
- X i = SYS_FUEL;
- X else if (r < 0.95)
- X i = SYS_HUD;
- X return i;
- X}
- X
- Xvoid damageSystem (c, sys)
- Xcraft *c;
- Xlong sys; {
- X
- X if ((c->damageBits & sys) || (sys == SYS_FUEL)) {
- X
- X c->damageBits &= ~ sys;
- X
- X switch (sys) {
- X
- X case SYS_ENGINE1:
- X c->throttle = 0;
- X break;
- X
- X case SYS_RADAR:
- X c->curRadarTarget = -1;
- X break;
- X
- X/*
- X * Fuel leaks can be up to 40 pounds per second here.
- X */
- X
- X case SYS_FUEL:
- X c->leakRate += (frandom() + frandom()) * 20.0;
- X break;
- X
- X case SYS_HYD1:
- X case SYS_HYD2:
- X if ((c->damageBits & (SYS_HYD1 | SYS_HYD2)) == 0) {
- X c->damageBits &= ~ SYS_SPEEDBRAKE;
- X c->damageBits &= ~ SYS_FLAPS;
- X }
- X break;
- X
- X case SYS_GEN1:
- X case SYS_GEN2:
- X if ((c->damageBits & (SYS_GEN1 | SYS_GEN2)) == 0) {
- X c->damageBits &= ~
- X (SYS_HUD | SYS_RADAR | SYS_TEWS);
- X break;
- X }
- X }
- X
- X }
- X}
- X
- X/*
- X * absorbDamage : craft c is hit with d points of damage.
- X */
- X
- Xint absorbDamage (c, d)
- Xcraft *c;
- Xint d; {
- X
- X double n;
- X register long sys;
- X
- X for (; d > 0; --d) {
- X
- X/*
- X * For each damage point absorbed, there is a 30 percent chance that
- X * it will be absorbed by some subsystem other than the actual
- X * airframe.
- X */
- X
- X if (frandom() <= 0.30) {
- X sys = selectSystem();
- X damageSystem (c, sys);
- X }
- X
- X/*
- X * For each point absorbed by the airframe, there is a 20% chance that
- X * it'll be absorbed by the wing and induce a rolling moment or a 10
- X * percent chance that it will hit a horizontal stabilizer and induce
- X * a pitching and rolling moment.
- X */
- X
- X else {
- X
- X if ((n = frandom()) <= 0.20) {
- X c->damageCL += (frandom() - 0.5) * 0.20;
- X }
- X else if (n <= 0.30) {
- X c->damageCL += (frandom() - 0.5) * 0.10;
- X c->damageCM += (frandom() - 0.5) * 0.20;
- X }
- X
- X if (--(c->structurePts) <= 0)
- X return 0;
- X }
- X
- X }
- X
- X return 1;
- X
- X}
- X
- Xvoid initDamage (c)
- Xcraft *c; {
- X
- X c->damageBits = c->cinfo->damageBits;
- X c->structurePts = c->cinfo->structurePts;
- X c->leakRate = 0.0;
- X c->damageCL = 0.0;
- X c->damageCM = 0.0;
- X}
- END_OF_FILE
- if test 2826 -ne `wc -c <'acm/fsim/damage.c'`; then
- echo shar: \"'acm/fsim/damage.c'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/damage.c'
- fi
- if test -f 'acm/fsim/eng.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/eng.xbm'\"
- else
- echo shar: Extracting \"'acm/fsim/eng.xbm'\" \(3314 characters\)
- sed "s/^X//" >'acm/fsim/eng.xbm' <<'END_OF_FILE'
- X#define eng_width 64
- X#define eng_height 64
- X#define eng_x_hot 31
- X#define eng_y_hot 31
- Xstatic char eng_bits[] = {
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
- X 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00,
- X 0x00, 0x00, 0xf8, 0x03, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x36, 0xc0,
- X 0x01, 0x36, 0x00, 0x00, 0x00, 0x00, 0x0d, 0xc0, 0x01, 0x58, 0x00, 0x00,
- X 0x00, 0xc0, 0x03, 0x80, 0x00, 0xe0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x80,
- X 0x00, 0x80, 0x03, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00,
- X 0x00, 0x14, 0x00, 0xc0, 0x00, 0x00, 0x14, 0x00, 0x00, 0x0a, 0x00, 0x20,
- X 0x01, 0x00, 0x28, 0x00, 0x00, 0x05, 0x00, 0x20, 0x01, 0x00, 0x52, 0x00,
- X 0x00, 0x03, 0x00, 0x20, 0x01, 0x00, 0x66, 0x00, 0x80, 0x01, 0x00, 0x20,
- X 0x01, 0x00, 0xce, 0x00, 0xc0, 0x00, 0x00, 0x20, 0x01, 0x00, 0x83, 0x01,
- X 0xc0, 0x00, 0x00, 0x20, 0x01, 0x00, 0x80, 0x01, 0x60, 0x00, 0x00, 0xc0,
- X 0x00, 0x00, 0x00, 0x03, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
- X 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x28, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x0a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
- X 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
- X 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
- X 0x06, 0x62, 0x0c, 0x00, 0x00, 0x80, 0x31, 0x30, 0x06, 0x93, 0x12, 0x00,
- X 0x00, 0x40, 0x48, 0x30, 0x06, 0x92, 0x12, 0x00, 0x00, 0x40, 0x48, 0x30,
- X 0x76, 0x92, 0x12, 0x00, 0x00, 0xc0, 0x49, 0x37, 0x56, 0x92, 0x12, 0x80,
- X 0x00, 0x40, 0x4a, 0x35, 0x76, 0x92, 0x12, 0x00, 0x00, 0x40, 0x4a, 0x37,
- X 0x06, 0x92, 0x12, 0x00, 0x00, 0x40, 0x4a, 0x30, 0x06, 0x67, 0x0c, 0x00,
- X 0x00, 0x80, 0x31, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
- X 0x06, 0x00, 0xc0, 0x39, 0x91, 0x05, 0x00, 0x30, 0x0c, 0x00, 0x40, 0x4a,
- X 0x91, 0x04, 0x00, 0x18, 0x0c, 0x00, 0x40, 0x4a, 0x1b, 0x02, 0x00, 0x18,
- X 0x0c, 0x00, 0x40, 0x4a, 0x15, 0x02, 0x00, 0x18, 0x0c, 0x00, 0xc0, 0x39,
- X 0x15, 0x01, 0x00, 0x18, 0x18, 0x00, 0x40, 0x09, 0x91, 0x00, 0x00, 0x0c,
- X 0x18, 0x00, 0x40, 0x0a, 0x91, 0x06, 0x00, 0x0c, 0x28, 0x00, 0x40, 0x0a,
- X 0x11, 0x06, 0x00, 0x0a, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
- X 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x60, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x30, 0x06, 0x00, 0x80, 0x01,
- X 0xc0, 0x40, 0x00, 0x48, 0x09, 0x00, 0x81, 0x01, 0x80, 0x79, 0x00, 0x48,
- X 0x09, 0x00, 0xcf, 0x00, 0x00, 0x33, 0x00, 0x30, 0x09, 0x00, 0x66, 0x00,
- X 0x00, 0x25, 0x00, 0x48, 0x09, 0x00, 0x52, 0x00, 0x00, 0x0a, 0x00, 0x48,
- X 0x09, 0x00, 0x28, 0x00, 0x00, 0x14, 0x00, 0x48, 0x09, 0x00, 0x14, 0x00,
- X 0x00, 0x38, 0x00, 0x30, 0x06, 0x00, 0x0e, 0x00, 0x00, 0xe0, 0x00, 0x80,
- X 0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x80, 0x00, 0xe0, 0x01, 0x00,
- X 0x00, 0x00, 0x0d, 0x40, 0x01, 0x58, 0x00, 0x00, 0x00, 0x00, 0x36, 0xc0,
- X 0x01, 0x36, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xe0, 0x0f, 0x00, 0x00,
- X 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
- X 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- END_OF_FILE
- if test 3314 -ne `wc -c <'acm/fsim/eng.xbm'`; then
- echo shar: \"'acm/fsim/eng.xbm'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/eng.xbm'
- fi
- if test -f 'acm/fsim/exp.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/exp.xbm'\"
- else
- echo shar: Extracting \"'acm/fsim/exp.xbm'\" \(3272 characters\)
- sed "s/^X//" >'acm/fsim/exp.xbm' <<'END_OF_FILE'
- X#define exp_width 64
- X#define exp_height 64
- Xstatic char exp_bits[] = {
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
- X 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xc2, 0x61, 0x00, 0x03,
- X 0x00, 0x00, 0x00, 0x20, 0xc2, 0x21, 0x80, 0x03, 0x00, 0x00, 0x1c, 0x40,
- X 0xc0, 0x21, 0x80, 0x03, 0x00, 0x80, 0x30, 0x40, 0x80, 0x38, 0x80, 0x01,
- X 0x00, 0x80, 0x09, 0xa3, 0x82, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x11, 0x02,
- X 0xc2, 0x22, 0x40, 0x00, 0x00, 0x00, 0x86, 0x84, 0xc4, 0x00, 0x40, 0x00,
- X 0x00, 0x00, 0x80, 0x14, 0xc6, 0x02, 0x50, 0x00, 0xc0, 0x00, 0x0c, 0x8a,
- X 0xe9, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xa8, 0x18, 0xd3, 0x75, 0x02, 0x08,
- X 0x80, 0x01, 0xe0, 0x04, 0x3e, 0x03, 0x01, 0x04, 0x00, 0x05, 0x10, 0x92,
- X 0x8a, 0x0e, 0x06, 0x07, 0x00, 0x5c, 0x81, 0xf1, 0xef, 0x1b, 0x00, 0x02,
- X 0x00, 0x18, 0x80, 0x0c, 0xcf, 0x0b, 0xa5, 0x00, 0x00, 0x60, 0x88, 0x17,
- X 0xef, 0x07, 0x87, 0x00, 0x00, 0xa0, 0x21, 0x79, 0xc7, 0x55, 0x23, 0x00,
- X 0x00, 0x90, 0x40, 0x3f, 0xeb, 0x1e, 0x07, 0x00, 0x00, 0x00, 0x40, 0x9f,
- X 0xef, 0xbc, 0x17, 0x00, 0x00, 0xa4, 0x05, 0x9e, 0x2f, 0x71, 0x06, 0x00,
- X 0x00, 0x08, 0x00, 0x6f, 0x5f, 0xbc, 0x02, 0x00, 0x00, 0x40, 0xf9, 0x3c,
- X 0x01, 0xbf, 0x03, 0x00, 0x00, 0x00, 0xac, 0xb3, 0x5f, 0xfd, 0x03, 0x00,
- X 0x00, 0x00, 0xfc, 0xbb, 0x4f, 0xa7, 0x0b, 0x10, 0x00, 0x00, 0xd7, 0xad,
- X 0xc2, 0x9a, 0x0d, 0x04, 0x00, 0x40, 0xfb, 0xc9, 0x98, 0x79, 0x11, 0x19,
- X 0x00, 0xc0, 0xfa, 0x8d, 0x18, 0xcb, 0x3b, 0x02, 0x00, 0x80, 0xdd, 0x0d,
- X 0x88, 0x0b, 0x5f, 0x08, 0x00, 0xc0, 0x2d, 0x39, 0x60, 0x1b, 0xfa, 0x00,
- X 0x00, 0xd0, 0x7e, 0x97, 0xc1, 0x73, 0x58, 0x03, 0x00, 0x6b, 0xb1, 0x0e,
- X 0x01, 0xfb, 0x1c, 0x02, 0x00, 0x80, 0xdf, 0x15, 0x81, 0x54, 0xec, 0x02,
- X 0x00, 0x00, 0xfe, 0xff, 0xa2, 0xd9, 0x3c, 0x00, 0x00, 0x80, 0x7f, 0xde,
- X 0xc2, 0xac, 0xb4, 0x02, 0x00, 0x00, 0x33, 0xde, 0xec, 0x0b, 0x3e, 0x02,
- X 0x00, 0xc0, 0x6c, 0x17, 0xe1, 0xe7, 0xbc, 0x03, 0x00, 0x50, 0x76, 0xfd,
- X 0xf7, 0xfe, 0xff, 0x00, 0x00, 0x1c, 0x5d, 0x9c, 0xfa, 0xba, 0xe9, 0x00,
- X 0x00, 0x05, 0x63, 0xcc, 0x0e, 0xec, 0x99, 0x00, 0x00, 0x46, 0x82, 0x94,
- X 0x80, 0xff, 0x3a, 0x00, 0x80, 0x03, 0xe3, 0xd7, 0x89, 0xcb, 0x27, 0x00,
- X 0x00, 0x80, 0x21, 0x8f, 0x84, 0xc9, 0x3f, 0x00, 0x00, 0x00, 0x04, 0xff,
- X 0xcc, 0xdb, 0xe3, 0x01, 0x00, 0xa0, 0x00, 0xa6, 0x7e, 0x0b, 0xb1, 0x07,
- X 0x00, 0x00, 0x00, 0x19, 0x6f, 0x6e, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x9c,
- X 0xfa, 0x53, 0x06, 0x02, 0x00, 0x00, 0x00, 0x04, 0xe7, 0xa9, 0x00, 0x06,
- X 0x00, 0x00, 0x80, 0x43, 0x14, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
- X 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x0c, 0x40, 0x00, 0x00,
- X 0x00, 0x00, 0x40, 0x05, 0x08, 0x20, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00,
- X 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x03, 0x00,
- X 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00,
- X 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00,
- X 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x14, 0x00,
- X 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x30, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00};
- END_OF_FILE
- if test 3272 -ne `wc -c <'acm/fsim/exp.xbm'`; then
- echo shar: \"'acm/fsim/exp.xbm'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/exp.xbm'
- fi
- if test -f 'acm/fsim/exp1.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/exp1.xbm'\"
- else
- echo shar: Extracting \"'acm/fsim/exp1.xbm'\" \(3319 characters\)
- sed "s/^X//" >'acm/fsim/exp1.xbm' <<'END_OF_FILE'
- X#define exp1_width 64
- X#define exp1_height 64
- X#define exp1_x_hot -1
- X#define exp1_y_hot -1
- Xstatic char exp1_bits[] = {
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
- X 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x81, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x20, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
- X 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x80, 0x61, 0x00, 0x03,
- X 0x00, 0x00, 0x00, 0x20, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40,
- X 0x80, 0x20, 0x80, 0x01, 0x00, 0x80, 0x40, 0x40, 0x80, 0x38, 0x80, 0x01,
- X 0x00, 0x80, 0x01, 0xa0, 0x82, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00,
- X 0x82, 0x22, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0xc4, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x06, 0x02, 0x10, 0x00, 0x80, 0x00, 0x0c, 0x80,
- X 0xa9, 0x00, 0x00, 0x00, 0x00, 0x01, 0xa8, 0x10, 0x93, 0x75, 0x02, 0x20,
- X 0x00, 0x00, 0xe0, 0x04, 0x3e, 0x03, 0x01, 0x20, 0x00, 0x04, 0x10, 0x92,
- X 0x8a, 0x0e, 0x06, 0x1a, 0x00, 0x5c, 0x81, 0xf1, 0xef, 0x1b, 0x80, 0x01,
- X 0x00, 0x18, 0x80, 0x0c, 0xcb, 0x01, 0xa5, 0x00, 0x00, 0x60, 0x88, 0x17,
- X 0x43, 0x07, 0x87, 0x00, 0x00, 0xa0, 0x21, 0x79, 0xc7, 0x51, 0x23, 0x00,
- X 0x00, 0x80, 0x40, 0x3f, 0xeb, 0x1e, 0x07, 0x00, 0x00, 0x00, 0x40, 0x1f,
- X 0xef, 0xb8, 0x17, 0x00, 0x00, 0x04, 0x04, 0x06, 0x2c, 0x71, 0x06, 0x00,
- X 0x00, 0x08, 0x00, 0x6b, 0x5f, 0x10, 0x02, 0x00, 0x00, 0x40, 0xf9, 0x38,
- X 0x01, 0xbf, 0x01, 0x00, 0x00, 0x00, 0xac, 0xb3, 0x5f, 0xfd, 0x03, 0x00,
- X 0x00, 0x00, 0xfc, 0xb9, 0x4f, 0xa7, 0x03, 0x10, 0x00, 0x00, 0xd7, 0xac,
- X 0xc2, 0x9a, 0x0d, 0x04, 0x10, 0x40, 0x7b, 0xc9, 0x98, 0x79, 0x11, 0x18,
- X 0x00, 0xc0, 0xfa, 0x8d, 0x18, 0xcb, 0x29, 0x02, 0x00, 0x80, 0xd8, 0x0d,
- X 0x88, 0x0b, 0x57, 0x08, 0x00, 0xc0, 0x0c, 0x39, 0x60, 0x1b, 0x00, 0x00,
- X 0x00, 0xd0, 0x64, 0x97, 0xc1, 0x73, 0x18, 0x03, 0x00, 0x6b, 0x81, 0x0e,
- X 0x01, 0xfb, 0x0c, 0x02, 0x00, 0x80, 0xdf, 0x15, 0x81, 0x54, 0xe8, 0x02,
- X 0x00, 0x00, 0xde, 0xff, 0xa2, 0xd9, 0x3c, 0x00, 0x00, 0x80, 0x3f, 0xde,
- X 0xc2, 0xac, 0x94, 0x00, 0x00, 0x00, 0x33, 0xde, 0xec, 0x0b, 0x1e, 0x02,
- X 0x00, 0xc0, 0x6c, 0x17, 0xe1, 0xe7, 0x1c, 0x02, 0x00, 0x50, 0x76, 0xfc,
- X 0xf7, 0xfe, 0x3f, 0x00, 0x00, 0x1c, 0x5d, 0x9c, 0xfa, 0xba, 0x09, 0x00,
- X 0x00, 0x04, 0x63, 0xcc, 0x0e, 0x8c, 0x89, 0x00, 0x00, 0x46, 0x82, 0x90,
- X 0x80, 0xbb, 0x12, 0x00, 0x00, 0x02, 0xe3, 0xd7, 0x89, 0x81, 0x23, 0x00,
- X 0x80, 0x81, 0x21, 0x83, 0x84, 0x89, 0x03, 0x00, 0x00, 0x00, 0x04, 0xf7,
- X 0xcc, 0xdb, 0xe3, 0x00, 0x20, 0xa0, 0x00, 0xa6, 0x7e, 0x0b, 0xb1, 0x01,
- X 0x20, 0x00, 0x00, 0x19, 0x6f, 0x4e, 0x8e, 0x00, 0x10, 0x00, 0x00, 0x1c,
- X 0xe0, 0x53, 0x06, 0x02, 0x00, 0x00, 0x00, 0x04, 0xe7, 0xa9, 0x00, 0x02,
- X 0x00, 0x00, 0x80, 0x43, 0x14, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
- X 0x00, 0x88, 0x00, 0x0c, 0x00, 0x00, 0xc0, 0x00, 0x0c, 0x40, 0x00, 0x08,
- X 0x00, 0x00, 0x40, 0x05, 0x08, 0x20, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00,
- X 0x04, 0x00, 0x02, 0x18, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x03, 0x10,
- X 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x08, 0x08, 0x00,
- X 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00,
- X 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x10, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00};
- END_OF_FILE
- if test 3319 -ne `wc -c <'acm/fsim/exp1.xbm'`; then
- echo shar: \"'acm/fsim/exp1.xbm'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/exp1.xbm'
- fi
- if test -f 'acm/fsim/f16' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/f16'\"
- else
- echo shar: Extracting \"'acm/fsim/f16'\" \(3135 characters\)
- sed "s/^X//" >'acm/fsim/f16' <<'END_OF_FILE'
- XF-16-fighter
- X130 12
- X1 -18.165 0 0
- X2 -18.165 -1.191 0
- X3 -15.187 -2.085 0
- X4 -13.698 -2.382 0
- X5 -17.272 -2.382 0
- X6 -17.272 -3.573 0
- X7 -10.923 -3.573 0
- X8 -4.169 -3.573 0
- X9 -4.169 -4.765 0
- X10 5.598 -4.765 0
- X11 18.463 -2.144 0
- X12 18.939 -1.787 0
- X13 22.274 -1.489 0
- X14 24.895 -1.191 0
- X15 27.992 0 0
- X16 -6.551 -3.573 0
- X17 -6.551 -15.485 0
- X18 0.357 -15.485 0
- X19 0.357 -15.187 0
- X20 -2.978 -15.008 0
- X21 5.598 -4.765 0
- X22 -4.169 -4.765 0
- X23 -4.169 -3.573 0
- X24 -17.272 -3.573 0
- X25 -17.272 -8.934 0.893
- X26 -15.187 -8.934 0.893
- X27 -10.923 -3.573 0
- X28 27.992 0 0
- X29 24.895 1.191 0
- X30 22.274 1.489 0
- X31 18.939 1.787 0
- X32 18.463 2.144 0
- X33 5.598 4.765 0
- X34 -4.169 4.765 0
- X35 -4.169 3.573 0
- X36 -10.923 3.573 0
- X37 -17.272 3.573 0
- X38 -17.272 2.382 0
- X39 -13.698 2.382 0
- X40 -15.187 2.085 0
- X41 -18.165 1.191 0
- X42 -18.165 0 0
- X43 5.598 4.765 0
- X44 -2.978 15.008 0
- X45 0.357 15.187 0
- X46 0.357 15.485 0
- X47 -6.551 15.485 0
- X48 -6.551 3.573 0
- X49 -4.169 3.573 0
- X50 -4.169 4.765 0
- X51 -10.923 3.573 0
- X52 -15.187 8.934 0.893
- X53 -17.272 8.934 0.893
- X54 -17.272 3.573 0
- X55 27.992 0 0
- X56 23.525 0 -1.191
- X57 17.272 0 -2.382
- X58 15.783 0 -3.812
- X59 13.996 0 -4.169
- X60 11.316 0 -4.05
- X61 8.338 0 -3.335
- X62 1.787 0 -2.382
- X63 -4.169 0 -2.382
- X64 -13.936 0 -1.906
- X65 -15.128 0 -1.906
- X66 -15.187 0 -1.787
- X67 -18.165 0 -1.191
- X68 -18.165 0 0
- X69 -4.169 0 -2.382
- X70 -10.125 0 -4.05
- X71 -15.783 0 -10.482
- X72 -19.654 0 -10.482
- X73 -19.654 0 -9.529
- X74 -19.654 0 -9.529
- X75 -16.378 0 -3.573
- X76 -16.378 0 -2.144
- X77 -14.889 0 -2.382
- X78 -13.936 0 -2.382
- X79 -13.936 0 -1.906
- X80 -18.165 0 0
- X81 -18.165 0 1.191
- X82 -15.187 0 2.085
- X83 -13.698 0 2.263
- X84 -2.68 0 2.382
- X85 8.04 0 2.382
- X86 12.507 0 2.263
- X87 12.507 0 0.596
- X88 19.952 0 0.596
- X89 23.525 0 0.476
- X90 27.992 0 0
- X91 -3.551 0 -2.382
- X92 -3.551 -3.871 -0.10
- X93 -3.551 -15.485 0
- X94 -3.551 -15.485 0.1065
- X95 -3.551 -3.871 0.142
- X96 -3.551 -2.58 0.2556
- X97 -3.551 -2.387 1.818
- X98 -3.551 -2.102 2.015
- X99 -3.551 -1.03 2.251
- X100 -3.551 0 2.282
- X101 -3.551 1.03 2.251
- X102 -3.551 2.102 2.015
- X103 -3.551 2.387 1.818
- X104 -3.551 2.58 0.2556
- X105 -3.551 3.871 0.142
- X106 -3.551 15.485 0.1065
- X107 -3.551 15.485 0
- X108 -3.551 3.871 -0.10
- X109 13.996 0 -4.169
- X110 13.996 -0.8932 -3.692
- X111 13.996 -1.191 -2.978
- X112 13.996 -1.251 -2.502
- X113 13.996 -1.787 -1.311
- X114 13.996 -3.054 0
- X115 13.996 -1.583 0.3568
- X116 13.996 0 0.596
- X117 13.996 1.583 0.3568
- X118 13.996 3.054 0
- X119 13.996 1.787 -1.311
- X120 13.996 1.251 -2.502
- X121 13.996 1.191 -2.978
- X122 13.996 0.8932 -3.692
- X123 -18.165 1.191 0
- X124 -18.165 0.842 0.842
- X125 -18.165 0 1.191
- X126 -18.165 -0.842 0.842
- X127 -18.165 -1.191 0
- X128 -18.165 -0.842 -0.842
- X129 -18.165 0 -1.191
- X130 -18.165 0.842 -0.842
- Xgray44 14 109 110 111 112 113 114 115 116 117 118 119 120 121 122
- Xgray44 18 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
- Xgray44 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Xgray44 8 16 17 18 19 20 21 22 23
- Xgray44 4 24 25 26 27
- Xgray44 15 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
- Xgray44 8 43 44 45 46 47 48 49 50
- Xgray44 4 51 52 53 54
- Xgray44 14 55 56 57 58 59 60 61 62 63 64 65 66 67 68
- Xgray44 11 69 70 71 72 73 74 75 76 77 78 79
- Xgray44 11 80 81 82 83 84 85 86 87 88 89 90
- Xgray44 8 123 124 125 126 127 128 129 130
- END_OF_FILE
- if test 3135 -ne `wc -c <'acm/fsim/f16'`; then
- echo shar: \"'acm/fsim/f16'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/f16'
- fi
- if test -f 'acm/fsim/flaps.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/flaps.c'\"
- else
- echo shar: Extracting \"'acm/fsim/flaps.c'\" \(2198 characters\)
- sed "s/^X//" >'acm/fsim/flaps.c' <<'END_OF_FILE'
- X/*
- X * xflight : an aerial combat simulator for X
- X *
- X * Written by Riley Rainey, riley@mips.com
- X *
- X * Permission to use, copy, modify and distribute (without charge) this
- X * software, documentation, images, etc. is granted, provided that this
- X * comment and the author's name is retained.
- X *
- X */
- X
- X#include "pm.h"
- X
- Xint flapsDown (c)
- Xcraft *c; {
- X
- X c->flapSetting += 10.0 * pi / 180.0;
- X if (c->flapSetting > c->cinfo->maxFlap)
- X c->flapSetting = c->cinfo->maxFlap;
- X return 0;
- X}
- X
- Xint flapsUp (c)
- Xcraft *c; {
- X
- X c->flapSetting -= 10.0 * pi / 180.0;
- X if (c->flapSetting < 0.0)
- X c->flapSetting = 0.0;
- X return 0;
- X}
- X
- Xvoid flapControl (c)
- Xcraft *c; {
- X
- X if (isFunctioning(c, SYS_FLAPS)) {
- X
- X if (c->flapSetting > c->curFlap) {
- X c->curFlap += c->cinfo->flapRate * deltaT;
- X if (c->curFlap > c->flapSetting)
- X c->curFlap = c->flapSetting;
- X }
- X else if (c->flapSetting < c->curFlap) {
- X c->curFlap -= c->cinfo->flapRate * deltaT;
- X if (c->curFlap < c->flapSetting)
- X c->curFlap = c->flapSetting;
- X }
- X }
- X
- X if (isFunctioning(c, SYS_SPEEDBRAKE)) {
- X
- X if (c->speedBrakeSetting > c->curSpeedBrake) {
- X c->curSpeedBrake += c->cinfo->speedBrakeRate * deltaT;
- X if (c->curSpeedBrake > c->speedBrakeSetting)
- X c->curSpeedBrake = c->speedBrakeSetting;
- X }
- X else if (c->speedBrakeSetting < c->curSpeedBrake) {
- X c->curSpeedBrake -= c->cinfo->speedBrakeRate * deltaT;
- X if (c->curSpeedBrake < c->speedBrakeSetting)
- X c->curSpeedBrake = c->speedBrakeSetting;
- X }
- X }
- X
- X/*
- X * Set some status flags
- X */
- X
- X if (c->fuel < 1000.0)
- X c->damageBits &= ~FLAG_LOWFUEL;
- X else
- X c->damageBits |= FLAG_LOWFUEL;
- X
- X if (c->flags & FL_BRAKES)
- X c->damageBits &= ~FLAG_WHEELBRAKE;
- X else
- X c->damageBits |= FLAG_WHEELBRAKE;
- X
- X if (c->speedBrakeSetting > 0.0)
- X c->damageBits &= ~FLAG_SPEEDBRAKE;
- X else
- X c->damageBits |= FLAG_SPEEDBRAKE;
- X}
- X
- Xint speedBrakeExtend (c)
- Xcraft *c; {
- X
- X c->speedBrakeSetting += c->cinfo->speedBrakeIncr;
- X if (c->speedBrakeSetting > c->cinfo->maxSpeedBrake)
- X c->speedBrakeSetting = c->cinfo->maxSpeedBrake;
- X return 0;
- X}
- X
- Xint speedBrakeRetract (c)
- Xcraft *c; {
- X
- X c->speedBrakeSetting -= c->cinfo->speedBrakeIncr;
- X if (c->speedBrakeSetting < 0.0)
- X c->speedBrakeSetting = 0.0;
- X return 0;
- X}
- END_OF_FILE
- if test 2198 -ne `wc -c <'acm/fsim/flaps.c'`; then
- echo shar: \"'acm/fsim/flaps.c'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/flaps.c'
- fi
- if test -f 'acm/fsim/flaps1.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/flaps1.xbm'\"
- else
- echo shar: Extracting \"'acm/fsim/flaps1.xbm'\" \(1730 characters\)
- sed "s/^X//" >'acm/fsim/flaps1.xbm' <<'END_OF_FILE'
- X#define flaps1_width 64
- X#define flaps1_height 32
- X#define flaps1_x_hot -1
- X#define flaps1_y_hot -1
- Xstatic char flaps1_bits[] = {
- X 0x00, 0xf0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0xde, 0xdd, 0xfd,
- X 0x1f, 0x00, 0x00, 0x00, 0x60, 0xef, 0xee, 0xee, 0xee, 0xff, 0x03, 0x00,
- X 0x70, 0x77, 0x77, 0x77, 0x77, 0xf7, 0x3f, 0x00, 0x58, 0xbb, 0xbb, 0xbb,
- X 0xbb, 0x7b, 0x01, 0x00, 0x48, 0xdf, 0xdd, 0xdd, 0xdd, 0x3d, 0x0f, 0x00,
- X 0xe8, 0xfe, 0xff, 0xff, 0xff, 0x9f, 0x3f, 0x00, 0x38, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00};
- END_OF_FILE
- if test 1730 -ne `wc -c <'acm/fsim/flaps1.xbm'`; then
- echo shar: \"'acm/fsim/flaps1.xbm'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/flaps1.xbm'
- fi
- if test -f 'acm/fsim/init.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/init.c'\"
- else
- echo shar: Extracting \"'acm/fsim/init.c'\" \(3350 characters\)
- sed "s/^X//" >'acm/fsim/init.c' <<'END_OF_FILE'
- X/*
- X * xflight : an aerial combat simulator for X
- X *
- X * Written by Riley Rainey, riley@mips.com
- X *
- X * Permission to use, copy, modify and distribute (without charge) this
- X * software, documentation, images, etc. is granted, provided that this
- X * comment and the author's name is retained.
- X *
- X */
- X
- X#include <string.h>
- X#include "pm.h"
- X
- Xextern craftType *newCraft();
- Xextern void initaim9(), initm61a1();
- Xextern void initf16(), initmig23();
- X
- XFILE *acm_fopen (name, access)
- Xchar *name, *access; {
- X
- X FILE *f;
- X char libname[256];
- X
- X if ((f = fopen (name, access)) == (FILE *) NULL) {
- X strcpy (libname, ACM_LIBRARY);
- X strcat (libname, name);
- X return fopen (libname, access);
- X }
- X
- X return f;
- X}
- X
- Xint init () {
- X
- X FILE *f;
- X static VObject *o2;
- X int i;
- X craft *p;
- X
- X for ((i=0, p=stbl); i<MAXSURFACE; (++i, ++p))
- X p->type = CT_FREE;
- X
- X for ((i=0, p=ptbl); i<MAXPLAYERS; (++i, ++p)) {
- X p->index = i;
- X p->type = CT_FREE;
- X }
- X
- X for ((i=0, p=mtbl); i<MAXPROJECTILES; (++i, ++p))
- X p->type = CT_FREE;
- X
- X/* HUDColor = VAllocColor ("#ffc800"); */
- X HUDColor = VAllocColor ("white");
- X/* groundColor = VAllocColor ("#29350B"); */
- X/* groundColor = VAllocColor ("#717844"); */
- X groundColor = VAllocColor ("#879349");
- X whiteColor = VAllocColor ("white");
- X blackColor = VAllocColor ("black");
- X
- X/*
- X * Read in the runway and place it.
- X */
- X
- X f = acm_fopen ("rwy", "r");
- X stbl[1].type = CT_SURFACE;
- X stbl[1].cinfo = newCraft();
- X stbl[1].cinfo->object = VReadObject(f);
- X fclose (f);
- X stbl[1].Sg.x = 0.0;
- X stbl[1].Sg.y = 0.0;
- X stbl[1].Sg.z = 0.0;
- X stbl[1].curHeading = stbl[1].curPitch = stbl[1].curRoll = 0.0;
- X
- X f = acm_fopen ("rwy2", "r");
- X stbl[0].type = CT_SURFACE;
- X stbl[0].cinfo = newCraft();
- X stbl[0].cinfo->object = VReadObject(f);
- X fclose (f);
- X stbl[0].Sg.x = 4000.0;
- X stbl[0].Sg.y = 3000.0;
- X stbl[0].Sg.z = 0.0;
- X stbl[0].curHeading = 300.0 * 3.14159 / 180.0;
- X stbl[0].curPitch = stbl[0].curRoll = 0.0;
- X
- X f = acm_fopen ("tower", "r");
- X stbl[2].type = CT_SURFACE;
- X stbl[2].cinfo = newCraft();
- X stbl[2].cinfo->object = VReadObject(f);
- X fclose (f);
- X stbl[2].Sg.x = 4000.0;
- X stbl[2].Sg.y = -700.0;
- X stbl[2].Sg.z = 0.0;
- X stbl[2].curHeading = stbl[2].curPitch = stbl[2].curRoll = 0.0;
- X
- X f = acm_fopen ("mtn", "r");
- X stbl[3].type = CT_SURFACE;
- X stbl[3].cinfo = newCraft();
- X stbl[3].cinfo->object = VReadObject(f);
- X fclose (f);
- X stbl[3].Sg.x = 20.0 * NM;
- X stbl[3].Sg.y = 6.0 * NM;
- X stbl[3].Sg.z = 0.0;
- X stbl[3].curHeading = DEGtoRAD (30.0);
- X stbl[3].curPitch = stbl[3].curRoll = 0.0;
- X
- X stbl[4].type = CT_SURFACE;
- X stbl[4].cinfo = stbl[3].cinfo;
- X stbl[4].Sg.x = -2.0 * NM;
- X stbl[4].Sg.y = 40.0 * NM;
- X stbl[4].Sg.z = 0.0;
- X stbl[4].curHeading = DEGtoRAD (160.0);
- X stbl[4].curPitch = stbl[4].curRoll = 0.0;
- X
- X stbl[5].type = CT_SURFACE;
- X stbl[5].cinfo = stbl[3].cinfo;
- X stbl[5].Sg.x = -2.6 * NM;
- X stbl[5].Sg.y = 43.0 * NM;
- X stbl[5].Sg.z = 0.0;
- X stbl[5].curHeading = DEGtoRAD (160.0);
- X stbl[5].curPitch = stbl[4].curRoll = 0.0;
- X
- X stbl[6].type = CT_SURFACE;
- X stbl[6].cinfo = stbl[1].cinfo;
- X stbl[6].Sg.x = -0.6 * NM;
- X stbl[6].Sg.y = 49.0 * NM;
- X stbl[6].Sg.z = 0.0;
- X stbl[6].curHeading = DEGtoRAD (0.0);
- X stbl[6].curPitch = stbl[6].curRoll = 0.0;
- X
- X initf16();
- X initmig23();
- X initf16();
- X initmig23();
- X initaim9();
- X initm61a1();
- X
- X/*
- X * Set time intervals.
- X */
- X
- X deltaT = (double) UPDATE_INTERVAL / 1000000.0;
- X
- X halfDeltaTSquared = 0.5 * deltaT * deltaT;
- X
- X return 0;
- X}
- END_OF_FILE
- if test 3350 -ne `wc -c <'acm/fsim/init.c'`; then
- echo shar: \"'acm/fsim/init.c'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/init.c'
- fi
- if test -f 'acm/fsim/mig23' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/mig23'\"
- else
- echo shar: Extracting \"'acm/fsim/mig23'\" \(2514 characters\)
- sed "s/^X//" >'acm/fsim/mig23' <<'END_OF_FILE'
- Xmig-23-wings-swept
- X88 10
- X1 36.5891 0 0
- X2 34.4368 0.86092 0
- X3 30.9931 1.29138 0
- X4 27.119 1.72184 0
- X5 20.6621 1.72184 0
- X6 18.9402 2.1523 0
- X7 14.2052 3.01322 0
- X8 -3.44368 2.58276 0
- X9 -9.03966 2.1523 0
- X10 -16.7879 0.86092 0
- X11 -18.0793 0.43046 0
- X12 -18.0793 0 0
- X13 36.5891 0 0
- X14 34.4368 -0.86092 0
- X15 30.9931 -1.29138 0
- X16 27.119 -1.72184 0
- X17 20.6621 -1.72184 0
- X18 18.9402 -2.1523 0
- X19 14.2052 -3.01322 0
- X20 -3.44368 -2.58276 0
- X21 -9.03966 -2.1523 0
- X22 -16.7879 -0.86092 0
- X23 -18.0793 -0.43046 0
- X24 -18.0793 0 0
- X25 14.2052 3.01322 -3.01322
- X26 4.73506 7.31782 -3.01322
- X27 6.02644 8.6092 -3.01322
- X28 -11.192 13.7747 -3.01322
- X29 -12.0529 13.7747 -3.01322
- X30 -14.2052 11.192 -3.01322
- X31 -14.2052 10.7615 -3.01322
- X32 -3.44368 2.58276 -3.01322
- X33 14.2052 -3.01322 -3.01322
- X34 4.73506 -7.31782 -3.01322
- X35 6.02644 -8.6092 -3.01322
- X36 -11.192 -13.7747 -3.01322
- X37 -12.0529 -13.7747 -3.01322
- X38 -14.2052 -11.192 -3.01322
- X39 -14.2052 -10.7615 -3.01322
- X40 -3.44368 -2.58276 -3.01322
- X41 -18.9402 3.01322 -1.72184
- X42 -20.2316 7.31782 -1.72184
- X43 -18.5098 8.6092 -1.72184
- X44 -9.03966 2.1523 -1.72184
- X45 -16.7879 0.86092 -1.72184
- X46 -18.9402 -3.01322 -1.72184
- X47 -20.2316 -7.31782 -1.72184
- X48 -18.5098 -8.6092 -1.72184
- X49 -9.03966 -2.1523 -1.72184
- X50 -16.7879 -0.86092 -1.72184
- X51 36.5891 0 0
- X52 33.1454 0 -1.29138
- X53 30.1322 0 -2.1523
- X54 25.8276 0 -2.58276
- X55 22.3839 0 -3.87414
- X56 18.0793 0 -4.3046
- X57 9.47012 0 -3.87414
- X58 -0.860918 0 -3.44368
- X59 -8.6092 0 -6.02644
- X60 -16.3575 0 -10.331
- X61 -18.9402 0 -9.03966
- X62 -18.0793 0 -3.87414
- X63 -19.8012 0 -3.44368
- X64 -17.2184 0 -1.72184
- X65 -18.0793 0 -1.72184
- X66 -18.0793 0 1.29138
- X67 -15.4966 0 1.72184
- X68 -6.4569 0 2.1523
- X69 10.331 0 2.1523
- X70 20.2316 0 1.72184
- X71 28.8408 0 1.29138
- X72 33.1454 0 0.86092
- X73 -15.4966 0 1.72184
- X74 -15.4966 0 4.3046
- X75 -13.3443 0 5.16552
- X76 -6.4569 0 2.1523
- X77 20.6621 1.72184 -3.01322
- X78 18.9402 2.1523 -3.01322
- X79 14.2052 3.01322 -3.01322
- X80 -3.44368 2.58276 -3.01322
- X81 -3.44368 -2.58276 -3.01322
- X82 14.2052 -3.01322 -3.01322
- X83 18.9402 -2.1523 -3.01322
- X84 20.6621 -1.72184 -3.01322
- X85 -3.44368 2.58276 -3.01322
- X86 -16.7879 0.86092 -1.72184
- X87 -16.7879 -0.86092 -1.72184
- X88 -3.44368 -2.58276 -3.01322
- Xgray44 12 1 2 3 4 5 6 7 8 9 10 11 12
- Xgray44 12 13 14 15 16 17 18 19 20 21 22 23 24
- Xgray44 8 25 26 27 28 29 30 31 32
- Xgray44 8 33 34 35 36 37 38 39 40
- Xgray44 5 41 42 43 44 45
- Xgray44 5 46 47 48 49 50
- Xgray44 22 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
- Xgray44 4 73 74 75 76
- Xgray44 8 77 78 79 80 81 82 83 84
- Xgray44 4 85 86 87 88
- END_OF_FILE
- if test 2514 -ne `wc -c <'acm/fsim/mig23'`; then
- echo shar: \"'acm/fsim/mig23'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/mig23'
- fi
- if test -f 'acm/fsim/missileCalc.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/missileCalc.c'\"
- else
- echo shar: Extracting \"'acm/fsim/missileCalc.c'\" \(2621 characters\)
- sed "s/^X//" >'acm/fsim/missileCalc.c' <<'END_OF_FILE'
- X/*
- X * xflight : an aerial combat simulator for X
- X *
- X * Written by Riley Rainey, riley@mips.com
- X *
- X * Permission to use, copy, modify and distribute (without charge) this
- X * software, documentation, images, etc. is granted, provided that this
- X * comment and the author's name is retained.
- X *
- X */
- X
- X#include <stdio.h>
- X#include <math.h>
- X#include "pm.h"
- X
- Xint mdebug = 0;
- Xextern double calcRho();
- Xextern void trackTarget();
- Xextern void craftToGround();
- X
- Xint missileCalculations (c)
- Xcraft *c; {
- X
- X double q, rho;
- X double FLift, FDrag, FWeight;
- X double Vmag;
- X VPoint F, Fg;
- X VMatrix mtx;
- X
- X/*
- X * Check for ground impact. We do this at the beginning to permit us to
- X * kill ground targets.
- X */
- X
- X if (c->Sg.z > 0.0) {
- X killMissile (c);
- X return 1;
- X }
- X
- X trackTarget (c);
- X
- X -- c->armFuse;
- X
- X/*
- X * Re-orient the body of the missile towards it's intended target.
- X */
- X
- X c->prevSg = c->Sg;
- X
- X rho = calcRho (-(c->Sg.z), &q);
- X
- X/*
- X * Compute the resultant force vector on the missile.
- X */
- X
- X Vmag = mag(c->Cg);
- X q = rho * c->cinfo->wingS * Vmag * Vmag * 0.5;
- X FLift = 0.0;
- X FDrag = c->cinfo->CDOrigin * q;
- X
- X if (mdebug) {
- X printf ("rho = %g, FLift = %g, FDrag = %g\n", rho, FLift, FDrag);
- X printf ("FThrust = %g\n", c->curThrust);
- X }
- X
- X F.x = c->curThrust - FDrag;
- X F.y = 0.0;
- X F.z = 0.0;
- X
- X/*
- X * Now calculate changes in position (Sg) and velocity (Cg).
- X */
- X
- X if ((c->fuel -= fuelUsed(c)) <= 0.0) {
- X if (c->curThrust > 0.0)
- X if (mdebug)
- X printf ("Missile burnout; velocity = %g fps (%g kts)\n", Vmag,
- X FPStoKTS(Vmag));
- X c->fuel = 0.0;
- X c->curThrust = 0.0;
- X }
- X
- X/*
- X * The missile's trihedral and Itrihedral matrices are managed by
- X * trackTarget().
- X */
- X
- X craftToGround (c, &F, &Fg);
- X FWeight = c->cinfo->emptyWeight + c->fuel;
- X Fg.z += FWeight;
- X
- X if (mdebug) {
- X printf ("v = %g kts, Fg = { %g, %g, %g }\n", FPStoKTS(Vmag),
- X Fg.x, Fg.y, Fg.z);
- X printf ("F = { %g, %g, %g }\n", F.x, F.y, F.z);
- X }
- X
- X
- X
- X/*
- X * Update the missile's position and velocity.
- X */
- X
- X
- X c->Sg.x += c->Cg.x * deltaT + Fg.x / FWeight * a * halfDeltaTSquared;
- X c->Sg.y += c->Cg.y * deltaT + Fg.y / FWeight * a * halfDeltaTSquared;
- X c->Sg.z += c->Cg.z * deltaT + Fg.z / FWeight * a * halfDeltaTSquared;
- X
- X c->Cg.x += Fg.x / FWeight * a * deltaT;
- X c->Cg.y += Fg.y / FWeight * a * deltaT;
- X c->Cg.z += Fg.z / FWeight * a * deltaT;
- X
- X
- X if (mdebug) {
- X printf ("Altitude = %g\n", -c->Sg.z);
- X printf ("Euler angles { %g, %g, %g }\n", RADtoDEG(c->curRoll),
- X RADtoDEG(c->curPitch), RADtoDEG(c->curHeading));
- X printf ("Cg = { %g, %g, %g }\n", c->Cg.x, c->Cg.y, c->Cg.z);
- X printf ("Sg = { %g, %g, %g }\n", c->Sg.x, c->Sg.y, c->Sg.z);
- X }
- X
- X return 0;
- X}
- END_OF_FILE
- if test 2621 -ne `wc -c <'acm/fsim/missileCalc.c'`; then
- echo shar: \"'acm/fsim/missileCalc.c'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/missileCalc.c'
- fi
- if test -f 'acm/fsim/panel.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'acm/fsim/panel.c'\"
- else
- echo shar: Extracting \"'acm/fsim/panel.c'\" \(1940 characters\)
- sed "s/^X//" >'acm/fsim/panel.c' <<'END_OF_FILE'
- X/*
- X * xflight : an aerial combat simulator for X
- X *
- X * Written by Riley Rainey, riley@mips.com
- X *
- X * Permission to use, copy, modify and distribute (without charge) this
- X * software, documentation, images, etc. is granted, provided that this
- X * comment and the author's name is retained.
- X *
- X */
- X
- X#include "pm.h"
- X
- Xstatic struct {
- X long mask;
- X char *name;
- X } *pptr, panelVec[] = {
- X SYS_ENGINE1, "OIL PRES",
- X SYS_HYD1, "HYD1 PRES",
- X SYS_HYD2, "HYD2 PRES",
- X SYS_GEN1, "GEN1 FAIL",
- X SYS_GEN2, "GEN2 FAIL",
- X SYS_FLAPS, "FLAP FAIL",
- X SYS_SPEEDBRAKE, "SPBRK FAIL",
- X SYS_RADAR, "RADAR FAIL",
- X SYS_TEWS, "TEWS FAIL",
- X SYS_HUD, " HUD FAIL",
- X FLAG_LOWFUEL, " LOW FUEL",
- X FLAG_SPEEDBRAKE, "SPD BRAKE",
- X FLAG_WHEELBRAKE, " BRAKES",
- X 0, (char *) 0 };
- X
- X#define panelRows 7
- X#define panelChars 10
- X#define lightMargin ((u->rftw + 1) / 3)
- X#define panelWMargin (u->rftw * 2)
- X#define panelHMargin (u->rfth / 2)
- X
- Xlong lastBits[MAXPLAYERS];
- X
- Xvoid initPanel (c)
- Xcraft *c; {
- X
- X lastBits [c->index] = SYS_NODAMAGE;
- X
- X}
- X
- Xvoid doPanel (c, u)
- Xcraft *c;
- Xviewer *u; {
- X
- X int cellH, cellW;
- X int xi, yi, x, y, i;
- X long changeBits;
- X
- X cellH = u->rfth + 2 * lightMargin + panelHMargin;
- X cellW = u->rftw * panelChars + 2 * lightMargin + panelWMargin;
- X
- X XSetForeground (u->dpy, u->gc, WhitePixel(u->v->dpy, u->v->screen));
- X
- X changeBits = lastBits[c->index] ^ c->damageBits;
- X
- X for (pptr = &panelVec[0], i=0; pptr->mask != 0; ++pptr, ++i) {
- X if (changeBits & pptr->mask) {
- X xi = i / panelRows;
- X yi = i % panelRows;
- X x = u->scaleFactor * PANEL_X + 0.5;
- X x += xi * cellW + lightMargin;
- X y = u->scaleFactor * PANEL_Y + 0.5;
- X y += yi * cellH + lightMargin;
- X if ((c->damageBits & pptr->mask) == 0)
- X XDrawImageString (u->dpy, u->win, u->gc,
- X x, y, pptr->name, strlen(pptr->name));
- X else {
- X y -= u->rfth;
- X XClearArea (u->dpy, u->win, x, y,
- X u->rftw * panelChars,
- X u->rfth + lightMargin, False);
- X }
- X }
- X }
- X
- X lastBits[c->index] = c->damageBits;
- X}
- END_OF_FILE
- if test 1940 -ne `wc -c <'acm/fsim/panel.c'`; then
- echo shar: \"'acm/fsim/panel.c'\" unpacked with wrong size!
- fi
- # end of 'acm/fsim/panel.c'
- fi
- echo shar: End of archive 2 \(of 9\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 9 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
- --
- Riley Rainey Internet: riley@mips.com
- MIPS Computer Systems Phone: +1 214 770-7979
- Dallas, Texas
-